package com.study.utils;

import org.aspectj.lang.ProceedingJoinPoint;

public class Logger {
    public void writter(){
        System.out.println("现在开始写日志....");
    }
    public Object writterAround(ProceedingJoinPoint pjp){
        Object rv=null;
        try {
            System.out.println("现在开始写日志....前置");
            rv=pjp.proceed(pjp.getArgs());
            System.out.println("现在开始写日志....后置");
            return rv;
        }catch (Throwable t){
            System.out.println("现在开始写日志....异常");
            throw new RuntimeException(t);
        }finally {
            System.out.println("现在开始写日志....最终");
        }

    }
}
